package com.sinodata.bsm.center.dao;

import java.util.List;

import com.sinodata.bsm.center.bean.Condition;
import com.sinodata.bsm.center.bean.EventCorrelationPolicyBean;
import com.sinodata.bsm.center.bean.Page;
import com.sinodata.bsm.common.vo.EventCorrelation;

/**
 * <p>
 * Description: 事件相关性数据库操作，包括策略数据和关系数据
 * </p>
 *
 * @author dongyushi
 * @version 1.0

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2012-6-14 PM 4:52:10     dongyushi        1.0         To create
 * </p>
 *
 * @since 
 * @see     
 */
public interface EventCorrelationDao {

    /**
     * 分页查询事件相关性策略
     * 
     * @param page
     * @return
     */
    public Page<EventCorrelationPolicyBean> findEventCorrelationPolicyByPage(Page<EventCorrelationPolicyBean> page, Condition condition);

    /**
     * 通过主事件ID，从事件ID查询事件关联数据
     * 
     * @param mainEventId
     * @param subEventId
     * @return
     */
    public List<EventCorrelation> findByMainAndSubEvent(Long mainEventId, Long subEventId);

    public int getByName(String name);

    /**
     * 通过主事件ID查询从事件，递归查询遍历全部从事件(包含子事件的子事件...)
     * 
     * @param mainEventId
     * @return
     */
    public List<EventCorrelation> findByMainEvent(Long mainEventId);
}